import re
import sys

timestamp = None
state = 0

print('timestamp,currency,passive,aggressive,reserved')

for line in sys.stdin:
  if state == 0:
    if line.startswith('* 2018'):
      timestamp = line[2:-1]
      state = 1
  elif state == 1:
    splitted = re.split('\ +', line)
    assert len(splitted) == 9
    state = 2
  elif state == 2:
    assert line.startswith('---')
    state = 3
  elif state == 3:
    splitted = re.split('\ +', line)
    assert len(splitted) == 5, line
    state = 4
  elif state == 4:
    splitted = re.split('\ +', line)
    if len(splitted) == 9:
      okex = float(splitted[2])
      binance = float(splitted[3])
      currency = splitted[1]
      reserved = float(splitted[5])
      print('"%s",%s,%f,%f,%f' % (timestamp, currency, okex, binance, reserved))
    else:
      if line.startswith(' KRW: '):
        pnl = float(splitted[5][:-1])
        print('"%s",%s,%f,%f,%f' % (timestamp, 'AdjustedQuote', 0, 0, pnl))
        state = 0
